Networking
2013/12/18 |
[1] | Set Hostname and static IP address to the server, DHCP is not recommended if you use as a server. ( Replace the section 'ifcfg-***' to your own interface name ) |
# install the package below which includes ifconfig, netstat and so on first [root@localhost ~]# yum -y install net-tools
[root@localhost ~]#
vi /etc/hostname # add your hostname dlp.srv.world
[root@localhost ~]#
vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
[root@localhost ~]# # change BOOTPROTO=" none "DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_PEERDNS="yes" IPV6_PEERROUTES="yes" IPV6_FAILURE_FATAL="no" NAME="eth0" UUID="29de82a4-710e-4cc0-b797-bb687dd32688" ONBOOT="yes" HWADDR="00:0C:29:09:A9:B4" PEERDNS="yes" PEERROUTES="yes" # add like follows # this server's IP address IPADDR="10.0.0.30" # subnet mask NETMASK="255.255.255.0" # default gateway GATEWAY="10.0.0.1" # DNS server's IP address DNS1="10.0.0.10" systemctl disable NetworkManager.service rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service' rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service' rm '/etc/systemd/system/network.target.wants/NetworkManager-wait-online.service' [root@localhost ~]# chkconfig network on
[root@localhost ~]# Fedora release 20 (Heisenbug) Kernel 3.11.10-301.fc20.x86_64 on an x86_64 (ttyS0) dlp login: root Password:[root@dlp ~]# eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.0.30 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::216:36ff:fea1:bbb6 prefixlen 64 scopeid 0x20<link> ether 00:16:36:a1:bb:b6 txqueuelen 1000 (Ethernet) RX packets 30 bytes 2336 (2.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 41 bytes 2820 (2.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
[2] | Disable IPv6 if you do not need it. |
[root@dlp ~]#
vi /etc/default/grub # line 6 : add like follows GRUB_CMDLINE_LINUX=" ipv6.disable=1 rd.lvm.lv=fedora/swap rd.md=0.....
# reload [root@dlp ~]# grub2-mkconfig -o /boot/grub2/grub.cfg [root@dlp ~]# |